package com.pay.game.central.web.service;

import com.pay.game.central.web.mapper.CountMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class CountService {

    @Autowired
    private CountMapper countMapper;

    public Map userCount(String userId) {
        Map result = new HashMap();
        Map query = countMapper.userCount(userId);
        if (query == null) return query;
        result.put("limitScore", query.get("score"));
        result.put("currentScore", query.get("used_score"));
        result.put("orderSize", query.get("limit_times"));
        result.put("doneSize", query.get("done_times"));
        result.put("storeSize", query.get("store_size"));
        result.put("interestRate", query.get("interest_rate"));
        return result;
    }
}
